CREATE USER regress_user_ast;
SET allow_system_table_mods = off;
CREATE TABLE pg_catalog.test (a int);
CREATE TABLE t1x (a int, b anyarray);
ALTER TABLE pg_namespace ADD UNIQUE USING INDEX pg_namespace_oid_index;
INSERT INTO pg_description (objoid, classoid, objsubid, description) VALUES (0, 0, 0, 'foo');
GRANT INSERT ON pg_description TO regress_user_ast;
SET ROLE regress_user_ast;
INSERT INTO pg_description (objoid, classoid, objsubid, description) VALUES (0, 0, 1, 'foo');
RESET ROLE;
CREATE POLICY foo ON pg_description FOR SELECT USING (description NOT LIKE 'secret%');
CREATE SCHEMA pg_foo;
DROP TABLE pg_description;
TRUNCATE pg_description;
ALTER TABLE pg_description RENAME COLUMN description TO comment;
ALTER TABLE pg_description ALTER COLUMN description SET NOT NULL;
ALTER TABLE pg_description ALTER COLUMN description SET STATISTICS -1;
CREATE TABLE foo (a oid, b oid, c int, FOREIGN KEY (a, b, c) REFERENCES pg_description);
CREATE INDEX pg_descripton_test_index ON pg_description (description);
ALTER TABLE pg_description RENAME TO pg_comment;
ALTER TABLE pg_description SET SCHEMA public;
CREATE TABLESPACE pg_foo LOCATION '/no/such/location';
CREATE FUNCTION tf1() RETURNS triggerLANGUAGE plpgsqlAS BEGIN  RETURN NULL;
END ;
CREATE TRIGGER t1 BEFORE INSERT ON pg_description EXECUTE FUNCTION tf1();
ALTER TRIGGER t1 ON pg_description RENAME TO t2;
CREATE RULE r1 AS ON INSERT TO pg_description DO INSTEAD NOTHING;
ALTER RULE r1 ON pg_description RENAME TO r2;
SET allow_system_table_mods TO on;
CREATE RULE r2 AS ON INSERT TO pg_description DO INSTEAD NOTHING;
RESET allow_system_table_mods;
DROP RULE r2 ON pg_description;
SET allow_system_table_mods TO on;
DROP RULE r2 ON pg_description;
RESET allow_system_table_mods;
SET allow_system_table_mods = on;
BEGIN;
CREATE TABLE pg_catalog.test (a int);
ROLLBACK;
BEGIN;
CREATE TABLE t1 (a int, b anyarray);
ROLLBACK;
BEGIN;
ALTER TABLE pg_namespace ADD UNIQUE USING INDEX pg_namespace_oid_index;
ROLLBACK;
BEGIN;
INSERT INTO pg_description (objoid, classoid, objsubid, description) VALUES (0, 0, 2, 'foo');
ROLLBACK;
SET ROLE regress_user_ast;
INSERT INTO pg_description (objoid, classoid, objsubid, description) VALUES (0, 0, 3, 'foo');
RESET ROLE;
BEGIN;
CREATE POLICY foo ON pg_description FOR SELECT USING (description NOT LIKE 'secret%');
ROLLBACK;
BEGIN;
CREATE SCHEMA pg_foo;
ROLLBACK;
BEGIN;
DROP TABLE pg_description;
ROLLBACK;
BEGIN;
TRUNCATE pg_description;
ROLLBACK;
BEGIN;
ALTER TABLE pg_description RENAME COLUMN description TO comment;
ROLLBACK;
BEGIN;
ALTER TABLE pg_description ALTER COLUMN description SET NOT NULL;
ROLLBACK;
BEGIN;
ALTER TABLE pg_description ALTER COLUMN description SET STATISTICS -1;
ROLLBACK;
BEGIN;
ALTER TABLE pg_description ADD PRIMARY KEY USING INDEX pg_description_o_c_o_index;
CREATE TABLE foo (a oid, b oid, c int, FOREIGN KEY (a, b, c) REFERENCES pg_description);
ROLLBACK;
BEGIN;
CREATE INDEX pg_descripton_test_index ON pg_description (description);
ROLLBACK;
BEGIN;
ALTER TABLE pg_description RENAME TO pg_comment;
ROLLBACK;
BEGIN;
ALTER TABLE pg_description SET SCHEMA public;
ROLLBACK;
SET client_min_messages = error;
  CREATE TABLESPACE pg_foo LOCATION '/no/such/location';
  CREATE TABLESPACE pg_foo LOCATION '/no/such/location';
RESET client_min_messages;
CREATE TRIGGER t1 BEFORE INSERT ON pg_description EXECUTE FUNCTION tf1();
ALTER TRIGGER t1 ON pg_description RENAME TO t2;
DROP TRIGGER t2 ON pg_description;
CREATE RULE r1 AS ON INSERT TO pg_description DO INSTEAD NOTHING;
ALTER RULE r1 ON pg_description RENAME TO r2;
DROP RULE r2 ON pg_description;
REVOKE ALL ON pg_description FROM regress_user_ast;
DROP USER regress_user_ast;
DROP FUNCTION tf1;
